﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SWFUpLoad.ascx.cs" Inherits="GCEVideoMonitor.Monitor.UserControls.SWFUpLoad" %>
<link href="<%=this.VPath %>/css/default.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="<%=this.VPath %>/swfupload.js"></script>

<script type="text/javascript" src="<%=this.VPath %>/js/swfupload.queue.js"></script>

<script type="text/javascript" src="<%=this.VPath %>/js/fileprogress.js"></script>

<script type="text/javascript" src="<%=this.VPath %>/js/handlers.js"></script>

<script type="text/javascript">
    var swfu;

    window.onload = function() {
        var settings = {
        flash_url: "<%=this.VPath %>" + "/swfupload.swf",
            upload_url: "<%=this.UpLoadURL %>",
            post_params: {
                "ASPSESSID": "<%=Session.SessionID %>"
            },
            file_size_limit: "<%=this.MaxSize %>",
            file_types: "<%=this.FileType %>",
            file_types_description: "All Files",
            file_upload_limit: <%=this.FileLimit %>,
            file_queue_limit: 0,
            custom_settings: {
                progressTarget: "fsUploadProgress",
                cancelButtonId: "btnCancel"
            },
            debug: false,

            // Button settings
            button_image_url: "<%=this.VPath %>" + "/images/XPButtonNoText_160x22.png",
            button_placeholder_id: "spanButtonPlaceholder",
            button_width: 160,
            button_height: 22,
            button_text: '<span class="button">&nbsp; &nbsp;选择文件 &nbsp;  &nbsp;<span class="buttonSmall">(<%=this.MaxSize %> KB Max)</span></span>',
            button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }',
            button_text_top_padding: 1,
            button_text_left_padding: 5,

            // The event handler functions are defined in handlers.js
            file_queued_handler: fileQueued,
            file_queue_error_handler: fileQueueError,
            file_dialog_complete_handler: fileDialogComplete,
            upload_start_handler: uploadStart,
            upload_progress_handler: uploadProgress,
            upload_error_handler: uploadError,
            upload_success_handler: uploadSuccess,
            upload_complete_handler: uploadComplete,
            queue_complete_handler: queueComplete	// Queue plugin event
        };

        swfu = new SWFUpload(settings);
 
 
 
    };


 
    
</script>

<div>
    <div>
        <span id="spanButtonPlaceHolder"></span>
        <input id="btnCancel" type="button" value="取消全部上传" onclick="swfu.cancelQueue();"
            disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 22px;" class="dn_" />
    </div>
    <p>
        &nbsp;</p>
    <div class="fieldset flash" id="fsUploadProgress">
        <span class="legend">上传队列</span> 
    </div>
    <zf:TextBox class="dn_" runat="server" ID="tbUpLoadValue"></zf:TextBox>

    <script>

        function GetUpLoadFiles() {
            var result = [];
            $(successList).each(function() {

                result.push(this.serverData);
            });

            return result;
        }

        $(document.forms[0]).submit(function() {
            var str = "";
            $(GetUpLoadFiles()).each(function() {
                if (str == "")
                    str += this;
                else
                    str += ";" + this;
            });
            $("#<%=tbUpLoadValue.ClientID%>").val(str);
        });
  
    </script>
